package com.codefish.example.entity;

import com.codefish.framework.spring.beans.factory.IDisposableBean;
import com.codefish.framework.spring.beans.factory.IInitializingBean;
import lombok.Data;

import java.util.Date;

/**
 * @author <a href='https://gitee.com/hzf2281'>codefish</a>
 * @version 1.0.0
 * @since 2022/09/29 下午 03:04
 */
@Data
public class User implements IInitializingBean, IDisposableBean {
    private String name;
    private Integer age;
    private String sex;
    private Address address;
    private Date gmtCreated;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("User的afterPropertiesSet()方法被执行");
    }

    public void myInitMethod() {
        System.out.println("User的myInitMethod()方法被执行");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("User的destroy()方法被执行");
    }

    public void myDestroyMethod() {
        System.out.println("User的myDestroyMethod()方法被执行");
    }
}
